Integrand size = 18, antiderivative size = 346 \[ \int x^2 \cos \left (a+b \sqrt {c+d x}\right ) \, dx=\frac {240 \cos \left (a+b \sqrt {c+d x}\right )}{b^6 d^3}+\frac {24 c \cos \left (a+b \sqrt {c+d x}\right )}{b^4 d^3}+\frac {2 c^2 \cos \left (a+b \sqrt {c+d x}\right )}{b^2 d^3}-\frac {120 (c+d x) \cos \left (a+b \sqrt {c+d x}\right )}{b^4 d^3}-\frac {12 c (c+d x) \cos \left (a+b \sqrt {c+d x}\right )}{b^2 d^3}+\frac {10 (c+d x)^2 \cos \left (a+b \sqrt {c+d x}\right )}{b^2 d^3}+\frac {240 \sqrt {c+d x} \sin \left (a+b \sqrt {c+d x}\right )}{b^5 d^3}+\frac {24 c \sqrt {c+d x} \sin \left (a+b \sqrt {c+d x}\right )}{b^3 d^3}+\frac {2 c^2 \sqrt {c+d x} \sin \left (a+b \sqrt {c+d x}\right )}{b d^3}-\frac {40 (c+d x)^{3/2} \sin \left (a+b \sqrt {c+d x}\right )}{b^3 d^3}-\frac {4 c (c+d x)^{3/2} \sin \left (a+b \sqrt {c+d x}\right )}{b d^3}+\frac {2 (c+d x)^{5/2} \sin \left (a+b \sqrt {c+d x}\right )}{b d^3} \]
240*cos(a+b*(d*x+c)^(1/2))/b^6/d^3+24*c*cos(a+b*(d*x+c)^(1/2))/b^4/d^3+2*c ^2*cos(a+b*(d*x+c)^(1/2))/b^2/d^3-120*(d*x+c)*cos(a+b*(d*x+c)^(1/2))/b^4/d ^3-12*c*(d*x+c)*cos(a+b*(d*x+c)^(1/2))/b^2/d^3+10*(d*x+c)^2*cos(a+b*(d*x+c )^(1/2))/b^2/d^3-40*(d*x+c)^(3/2)*sin(a+b*(d*x+c)^(1/2))/b^3/d^3-4*c*(d*x+ c)^(3/2)*sin(a+b*(d*x+c)^(1/2))/b/d^3+2*(d*x+c)^(5/2)*sin(a+b*(d*x+c)^(1/2 ))/b/d^3+240*sin(a+b*(d*x+c)^(1/2))*(d*x+c)^(1/2)/b^5/d^3+24*c*sin(a+b*(d* x+c)^(1/2))*(d*x+c)^(1/2)/b^3/d^3+2*c^2*sin(a+b*(d*x+c)^(1/2))*(d*x+c)^(1/ 2)/b/d^3
Result contains complex when optimal does not.
Time = 0.93 (sec) , antiderivative size = 224, normalized size of antiderivative = 0.65 \[ \int x^2 \cos \left (a+b \sqrt {c+d x}\right ) \, dx=\frac {e^{-i \left (a+b \sqrt {c+d x}\right )} \left (120+120 i b \sqrt {c+d x}+i b^5 d^2 x^2 \sqrt {c+d x}-4 i b^3 \sqrt {c+d x} (2 c+5 d x)-12 b^2 (4 c+5 d x)+b^4 d x (4 c+5 d x)+e^{2 i \left (a+b \sqrt {c+d x}\right )} \left (120-120 i b \sqrt {c+d x}-i b^5 d^2 x^2 \sqrt {c+d x}+4 i b^3 \sqrt {c+d x} (2 c+5 d x)-12 b^2 (4 c+5 d x)+b^4 d x (4 c+5 d x)\right )\right )}{b^6 d^3} \]
(120 + (120*I)*b*Sqrt[c + d*x] + I*b^5*d^2*x^2*Sqrt[c + d*x] - (4*I)*b^3*S qrt[c + d*x]*(2*c + 5*d*x) - 12*b^2*(4*c + 5*d*x) + b^4*d*x*(4*c + 5*d*x) + E^((2*I)*(a + b*Sqrt[c + d*x]))*(120 - (120*I)*b*Sqrt[c + d*x] - I*b^5*d ^2*x^2*Sqrt[c + d*x] + (4*I)*b^3*Sqrt[c + d*x]*(2*c + 5*d*x) - 12*b^2*(4*c + 5*d*x) + b^4*d*x*(4*c + 5*d*x)))/(b^6*d^3*E^(I*(a + b*Sqrt[c + d*x])))
Time = 0.48 (sec) , antiderivative size = 348, normalized size of antiderivative = 1.01, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {3913, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int x^2 \cos \left (a+b \sqrt {c+d x}\right ) \, dx\) |
\(\Big \downarrow \) 3913 |
\(\displaystyle \frac {2 \int \left (\frac {\cos \left (a+b \sqrt {c+d x}\right ) (c+d x)^{5/2}}{d^2}-\frac {2 c \cos \left (a+b \sqrt {c+d x}\right ) (c+d x)^{3/2}}{d^2}+\frac {c^2 \cos \left (a+b \sqrt {c+d x}\right ) \sqrt {c+d x}}{d^2}\right )d\sqrt {c+d x}}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {2 \left (\frac {120 \cos \left (a+b \sqrt {c+d x}\right )}{b^6 d^2}+\frac {120 \sqrt {c+d x} \sin \left (a+b \sqrt {c+d x}\right )}{b^5 d^2}-\frac {60 (c+d x) \cos \left (a+b \sqrt {c+d x}\right )}{b^4 d^2}+\frac {12 c \cos \left (a+b \sqrt {c+d x}\right )}{b^4 d^2}-\frac {20 (c+d x)^{3/2} \sin \left (a+b \sqrt {c+d x}\right )}{b^3 d^2}+\frac {12 c \sqrt {c+d x} \sin \left (a+b \sqrt {c+d x}\right )}{b^3 d^2}+\frac {c^2 \cos \left (a+b \sqrt {c+d x}\right )}{b^2 d^2}+\frac {5 (c+d x)^2 \cos \left (a+b \sqrt {c+d x}\right )}{b^2 d^2}-\frac {6 c (c+d x) \cos \left (a+b \sqrt {c+d x}\right )}{b^2 d^2}+\frac {c^2 \sqrt {c+d x} \sin \left (a+b \sqrt {c+d x}\right )}{b d^2}+\frac {(c+d x)^{5/2} \sin \left (a+b \sqrt {c+d x}\right )}{b d^2}-\frac {2 c (c+d x)^{3/2} \sin \left (a+b \sqrt {c+d x}\right )}{b d^2}\right )}{d}\) |
(2*((120*Cos[a + b*Sqrt[c + d*x]])/(b^6*d^2) + (12*c*Cos[a + b*Sqrt[c + d* x]])/(b^4*d^2) + (c^2*Cos[a + b*Sqrt[c + d*x]])/(b^2*d^2) - (60*(c + d*x)* Cos[a + b*Sqrt[c + d*x]])/(b^4*d^2) - (6*c*(c + d*x)*Cos[a + b*Sqrt[c + d* x]])/(b^2*d^2) + (5*(c + d*x)^2*Cos[a + b*Sqrt[c + d*x]])/(b^2*d^2) + (120 *Sqrt[c + d*x]*Sin[a + b*Sqrt[c + d*x]])/(b^5*d^2) + (12*c*Sqrt[c + d*x]*S in[a + b*Sqrt[c + d*x]])/(b^3*d^2) + (c^2*Sqrt[c + d*x]*Sin[a + b*Sqrt[c + d*x]])/(b*d^2) - (20*(c + d*x)^(3/2)*Sin[a + b*Sqrt[c + d*x]])/(b^3*d^2) - (2*c*(c + d*x)^(3/2)*Sin[a + b*Sqrt[c + d*x]])/(b*d^2) + ((c + d*x)^(5/2 )*Sin[a + b*Sqrt[c + d*x]])/(b*d^2)))/d
3.1.90.3.1 Defintions of rubi rules used
Int[((a_.) + Cos[(c_.) + (d_.)*((e_.) + (f_.)*(x_))^(n_)]*(b_.))^(p_.)*((g_ .) + (h_.)*(x_))^(m_.), x_Symbol] :> Simp[1/(n*f) Subst[Int[ExpandIntegra nd[(a + b*Cos[c + d*x])^p, x^(1/n - 1)*(g - e*(h/f) + h*(x^(1/n)/f))^m, x], x], x, (e + f*x)^n], x] /; FreeQ[{a, b, c, d, e, f, g, h, m}, x] && IGtQ[p , 0] && IntegerQ[1/n]
Leaf count of result is larger than twice the leaf count of optimal. \(824\) vs. \(2(310)=620\).
Time = 1.51 (sec) , antiderivative size = 825, normalized size of antiderivative = 2.38
method | result | size |
derivativedivides | \(\frac {-2 a \,c^{2} \sin \left (a +b \sqrt {d x +c}\right )+2 c^{2} \left (\cos \left (a +b \sqrt {d x +c}\right )+\left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )+\frac {4 a^{3} c \sin \left (a +b \sqrt {d x +c}\right )}{b^{2}}-\frac {12 a^{2} c \left (\cos \left (a +b \sqrt {d x +c}\right )+\left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )}{b^{2}}+\frac {12 a c \left (\left (a +b \sqrt {d x +c}\right )^{2} \sin \left (a +b \sqrt {d x +c}\right )-2 \sin \left (a +b \sqrt {d x +c}\right )+2 \left (a +b \sqrt {d x +c}\right ) \cos \left (a +b \sqrt {d x +c}\right )\right )}{b^{2}}-\frac {4 c \left (\left (a +b \sqrt {d x +c}\right )^{3} \sin \left (a +b \sqrt {d x +c}\right )+3 \left (a +b \sqrt {d x +c}\right )^{2} \cos \left (a +b \sqrt {d x +c}\right )-6 \cos \left (a +b \sqrt {d x +c}\right )-6 \left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )}{b^{2}}-\frac {2 a^{5} \sin \left (a +b \sqrt {d x +c}\right )}{b^{4}}+\frac {10 a^{4} \left (\cos \left (a +b \sqrt {d x +c}\right )+\left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )}{b^{4}}-\frac {20 a^{3} \left (\left (a +b \sqrt {d x +c}\right )^{2} \sin \left (a +b \sqrt {d x +c}\right )-2 \sin \left (a +b \sqrt {d x +c}\right )+2 \left (a +b \sqrt {d x +c}\right ) \cos \left (a +b \sqrt {d x +c}\right )\right )}{b^{4}}+\frac {20 a^{2} \left (\left (a +b \sqrt {d x +c}\right )^{3} \sin \left (a +b \sqrt {d x +c}\right )+3 \left (a +b \sqrt {d x +c}\right )^{2} \cos \left (a +b \sqrt {d x +c}\right )-6 \cos \left (a +b \sqrt {d x +c}\right )-6 \left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )}{b^{4}}-\frac {10 a \left (\left (a +b \sqrt {d x +c}\right )^{4} \sin \left (a +b \sqrt {d x +c}\right )+4 \left (a +b \sqrt {d x +c}\right )^{3} \cos \left (a +b \sqrt {d x +c}\right )-12 \left (a +b \sqrt {d x +c}\right )^{2} \sin \left (a +b \sqrt {d x +c}\right )+24 \sin \left (a +b \sqrt {d x +c}\right )-24 \left (a +b \sqrt {d x +c}\right ) \cos \left (a +b \sqrt {d x +c}\right )\right )}{b^{4}}+\frac {2 \left (\left (a +b \sqrt {d x +c}\right )^{5} \sin \left (a +b \sqrt {d x +c}\right )+5 \left (a +b \sqrt {d x +c}\right )^{4} \cos \left (a +b \sqrt {d x +c}\right )-20 \left (a +b \sqrt {d x +c}\right )^{3} \sin \left (a +b \sqrt {d x +c}\right )-60 \left (a +b \sqrt {d x +c}\right )^{2} \cos \left (a +b \sqrt {d x +c}\right )+120 \cos \left (a +b \sqrt {d x +c}\right )+120 \left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )}{b^{4}}}{d^{3} b^{2}}\) | \(825\) |
default | \(\frac {-2 a \,c^{2} \sin \left (a +b \sqrt {d x +c}\right )+2 c^{2} \left (\cos \left (a +b \sqrt {d x +c}\right )+\left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )+\frac {4 a^{3} c \sin \left (a +b \sqrt {d x +c}\right )}{b^{2}}-\frac {12 a^{2} c \left (\cos \left (a +b \sqrt {d x +c}\right )+\left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )}{b^{2}}+\frac {12 a c \left (\left (a +b \sqrt {d x +c}\right )^{2} \sin \left (a +b \sqrt {d x +c}\right )-2 \sin \left (a +b \sqrt {d x +c}\right )+2 \left (a +b \sqrt {d x +c}\right ) \cos \left (a +b \sqrt {d x +c}\right )\right )}{b^{2}}-\frac {4 c \left (\left (a +b \sqrt {d x +c}\right )^{3} \sin \left (a +b \sqrt {d x +c}\right )+3 \left (a +b \sqrt {d x +c}\right )^{2} \cos \left (a +b \sqrt {d x +c}\right )-6 \cos \left (a +b \sqrt {d x +c}\right )-6 \left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )}{b^{2}}-\frac {2 a^{5} \sin \left (a +b \sqrt {d x +c}\right )}{b^{4}}+\frac {10 a^{4} \left (\cos \left (a +b \sqrt {d x +c}\right )+\left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )}{b^{4}}-\frac {20 a^{3} \left (\left (a +b \sqrt {d x +c}\right )^{2} \sin \left (a +b \sqrt {d x +c}\right )-2 \sin \left (a +b \sqrt {d x +c}\right )+2 \left (a +b \sqrt {d x +c}\right ) \cos \left (a +b \sqrt {d x +c}\right )\right )}{b^{4}}+\frac {20 a^{2} \left (\left (a +b \sqrt {d x +c}\right )^{3} \sin \left (a +b \sqrt {d x +c}\right )+3 \left (a +b \sqrt {d x +c}\right )^{2} \cos \left (a +b \sqrt {d x +c}\right )-6 \cos \left (a +b \sqrt {d x +c}\right )-6 \left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )}{b^{4}}-\frac {10 a \left (\left (a +b \sqrt {d x +c}\right )^{4} \sin \left (a +b \sqrt {d x +c}\right )+4 \left (a +b \sqrt {d x +c}\right )^{3} \cos \left (a +b \sqrt {d x +c}\right )-12 \left (a +b \sqrt {d x +c}\right )^{2} \sin \left (a +b \sqrt {d x +c}\right )+24 \sin \left (a +b \sqrt {d x +c}\right )-24 \left (a +b \sqrt {d x +c}\right ) \cos \left (a +b \sqrt {d x +c}\right )\right )}{b^{4}}+\frac {2 \left (\left (a +b \sqrt {d x +c}\right )^{5} \sin \left (a +b \sqrt {d x +c}\right )+5 \left (a +b \sqrt {d x +c}\right )^{4} \cos \left (a +b \sqrt {d x +c}\right )-20 \left (a +b \sqrt {d x +c}\right )^{3} \sin \left (a +b \sqrt {d x +c}\right )-60 \left (a +b \sqrt {d x +c}\right )^{2} \cos \left (a +b \sqrt {d x +c}\right )+120 \cos \left (a +b \sqrt {d x +c}\right )+120 \left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )}{b^{4}}}{d^{3} b^{2}}\) | \(825\) |
parts | \(\frac {2 x^{2} \sqrt {d x +c}\, \sin \left (a +b \sqrt {d x +c}\right )}{d b}+\frac {2 x^{2} \cos \left (a +b \sqrt {d x +c}\right )}{d \,b^{2}}-\frac {8 \left (2 a c \left (\sin \left (a +b \sqrt {d x +c}\right )-\left (a +b \sqrt {d x +c}\right ) \cos \left (a +b \sqrt {d x +c}\right )\right )+a^{2} c \cos \left (a +b \sqrt {d x +c}\right )-\frac {4 a^{3} \left (\sin \left (a +b \sqrt {d x +c}\right )-\left (a +b \sqrt {d x +c}\right ) \cos \left (a +b \sqrt {d x +c}\right )\right )}{b^{2}}-\frac {a^{4} \cos \left (a +b \sqrt {d x +c}\right )}{b^{2}}+\frac {6 a^{2} \left (-\left (a +b \sqrt {d x +c}\right )^{2} \cos \left (a +b \sqrt {d x +c}\right )+2 \cos \left (a +b \sqrt {d x +c}\right )+2 \left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )}{b^{2}}-\frac {4 a \left (-\left (a +b \sqrt {d x +c}\right )^{3} \cos \left (a +b \sqrt {d x +c}\right )+3 \left (a +b \sqrt {d x +c}\right )^{2} \sin \left (a +b \sqrt {d x +c}\right )-6 \sin \left (a +b \sqrt {d x +c}\right )+6 \left (a +b \sqrt {d x +c}\right ) \cos \left (a +b \sqrt {d x +c}\right )\right )}{b^{2}}-c \left (-\left (a +b \sqrt {d x +c}\right )^{2} \cos \left (a +b \sqrt {d x +c}\right )+2 \cos \left (a +b \sqrt {d x +c}\right )+2 \left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )+\frac {-\left (a +b \sqrt {d x +c}\right )^{4} \cos \left (a +b \sqrt {d x +c}\right )+4 \left (a +b \sqrt {d x +c}\right )^{3} \sin \left (a +b \sqrt {d x +c}\right )+12 \left (a +b \sqrt {d x +c}\right )^{2} \cos \left (a +b \sqrt {d x +c}\right )-24 \cos \left (a +b \sqrt {d x +c}\right )-24 \left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )}{b^{2}}-c \left (\cos \left (a +b \sqrt {d x +c}\right )+\left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )+a c \sin \left (a +b \sqrt {d x +c}\right )+\frac {3 a^{2} \left (\cos \left (a +b \sqrt {d x +c}\right )+\left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )\right )}{b^{2}}-\frac {a^{3} \sin \left (a +b \sqrt {d x +c}\right )}{b^{2}}-\frac {3 a \left (\left (a +b \sqrt {d x +c}\right )^{2} \sin \left (a +b \sqrt {d x +c}\right )-2 \sin \left (a +b \sqrt {d x +c}\right )+2 \left (a +b \sqrt {d x +c}\right ) \cos \left (a +b \sqrt {d x +c}\right )\right )}{b^{2}}+\frac {\left (a +b \sqrt {d x +c}\right )^{3} \sin \left (a +b \sqrt {d x +c}\right )+3 \left (a +b \sqrt {d x +c}\right )^{2} \cos \left (a +b \sqrt {d x +c}\right )-6 \cos \left (a +b \sqrt {d x +c}\right )-6 \left (a +b \sqrt {d x +c}\right ) \sin \left (a +b \sqrt {d x +c}\right )}{b^{2}}\right )}{d^{3} b^{4}}\) | \(848\) |
2/d^3/b^2*(-a*c^2*sin(a+b*(d*x+c)^(1/2))+c^2*(cos(a+b*(d*x+c)^(1/2))+(a+b* (d*x+c)^(1/2))*sin(a+b*(d*x+c)^(1/2)))+2/b^2*a^3*c*sin(a+b*(d*x+c)^(1/2))- 6/b^2*a^2*c*(cos(a+b*(d*x+c)^(1/2))+(a+b*(d*x+c)^(1/2))*sin(a+b*(d*x+c)^(1 /2)))+6/b^2*a*c*((a+b*(d*x+c)^(1/2))^2*sin(a+b*(d*x+c)^(1/2))-2*sin(a+b*(d *x+c)^(1/2))+2*(a+b*(d*x+c)^(1/2))*cos(a+b*(d*x+c)^(1/2)))-2/b^2*c*((a+b*( d*x+c)^(1/2))^3*sin(a+b*(d*x+c)^(1/2))+3*(a+b*(d*x+c)^(1/2))^2*cos(a+b*(d* x+c)^(1/2))-6*cos(a+b*(d*x+c)^(1/2))-6*(a+b*(d*x+c)^(1/2))*sin(a+b*(d*x+c) ^(1/2)))-1/b^4*a^5*sin(a+b*(d*x+c)^(1/2))+5/b^4*a^4*(cos(a+b*(d*x+c)^(1/2) )+(a+b*(d*x+c)^(1/2))*sin(a+b*(d*x+c)^(1/2)))-10/b^4*a^3*((a+b*(d*x+c)^(1/ 2))^2*sin(a+b*(d*x+c)^(1/2))-2*sin(a+b*(d*x+c)^(1/2))+2*(a+b*(d*x+c)^(1/2) )*cos(a+b*(d*x+c)^(1/2)))+10/b^4*a^2*((a+b*(d*x+c)^(1/2))^3*sin(a+b*(d*x+c )^(1/2))+3*(a+b*(d*x+c)^(1/2))^2*cos(a+b*(d*x+c)^(1/2))-6*cos(a+b*(d*x+c)^ (1/2))-6*(a+b*(d*x+c)^(1/2))*sin(a+b*(d*x+c)^(1/2)))-5/b^4*a*((a+b*(d*x+c) ^(1/2))^4*sin(a+b*(d*x+c)^(1/2))+4*(a+b*(d*x+c)^(1/2))^3*cos(a+b*(d*x+c)^( 1/2))-12*(a+b*(d*x+c)^(1/2))^2*sin(a+b*(d*x+c)^(1/2))+24*sin(a+b*(d*x+c)^( 1/2))-24*(a+b*(d*x+c)^(1/2))*cos(a+b*(d*x+c)^(1/2)))+1/b^4*((a+b*(d*x+c)^( 1/2))^5*sin(a+b*(d*x+c)^(1/2))+5*(a+b*(d*x+c)^(1/2))^4*cos(a+b*(d*x+c)^(1/ 2))-20*(a+b*(d*x+c)^(1/2))^3*sin(a+b*(d*x+c)^(1/2))-60*(a+b*(d*x+c)^(1/2)) ^2*cos(a+b*(d*x+c)^(1/2))+120*cos(a+b*(d*x+c)^(1/2))+120*(a+b*(d*x+c)^(1/2 ))*sin(a+b*(d*x+c)^(1/2))))
Time = 0.26 (sec) , antiderivative size = 103, normalized size of antiderivative = 0.30 \[ \int x^2 \cos \left (a+b \sqrt {c+d x}\right ) \, dx=\frac {2 \, {\left ({\left (b^{5} d^{2} x^{2} - 20 \, b^{3} d x - 8 \, b^{3} c + 120 \, b\right )} \sqrt {d x + c} \sin \left (\sqrt {d x + c} b + a\right ) + {\left (5 \, b^{4} d^{2} x^{2} - 48 \, b^{2} c + 4 \, {\left (b^{4} c - 15 \, b^{2}\right )} d x + 120\right )} \cos \left (\sqrt {d x + c} b + a\right )\right )}}{b^{6} d^{3}} \]
2*((b^5*d^2*x^2 - 20*b^3*d*x - 8*b^3*c + 120*b)*sqrt(d*x + c)*sin(sqrt(d*x + c)*b + a) + (5*b^4*d^2*x^2 - 48*b^2*c + 4*(b^4*c - 15*b^2)*d*x + 120)*c os(sqrt(d*x + c)*b + a))/(b^6*d^3)
Time = 0.38 (sec) , antiderivative size = 269, normalized size of antiderivative = 0.78 \[ \int x^2 \cos \left (a+b \sqrt {c+d x}\right ) \, dx=\begin {cases} \frac {x^{3} \cos {\left (a \right )}}{3} & \text {for}\: b = 0 \wedge \left (b = 0 \vee d = 0\right ) \\\frac {x^{3} \cos {\left (a + b \sqrt {c} \right )}}{3} & \text {for}\: d = 0 \\\frac {2 x^{2} \sqrt {c + d x} \sin {\left (a + b \sqrt {c + d x} \right )}}{b d} + \frac {8 c x \cos {\left (a + b \sqrt {c + d x} \right )}}{b^{2} d^{2}} + \frac {10 x^{2} \cos {\left (a + b \sqrt {c + d x} \right )}}{b^{2} d} - \frac {16 c \sqrt {c + d x} \sin {\left (a + b \sqrt {c + d x} \right )}}{b^{3} d^{3}} - \frac {40 x \sqrt {c + d x} \sin {\left (a + b \sqrt {c + d x} \right )}}{b^{3} d^{2}} - \frac {96 c \cos {\left (a + b \sqrt {c + d x} \right )}}{b^{4} d^{3}} - \frac {120 x \cos {\left (a + b \sqrt {c + d x} \right )}}{b^{4} d^{2}} + \frac {240 \sqrt {c + d x} \sin {\left (a + b \sqrt {c + d x} \right )}}{b^{5} d^{3}} + \frac {240 \cos {\left (a + b \sqrt {c + d x} \right )}}{b^{6} d^{3}} & \text {otherwise} \end {cases} \]
Piecewise((x**3*cos(a)/3, Eq(b, 0) & (Eq(b, 0) | Eq(d, 0))), (x**3*cos(a + b*sqrt(c))/3, Eq(d, 0)), (2*x**2*sqrt(c + d*x)*sin(a + b*sqrt(c + d*x))/( b*d) + 8*c*x*cos(a + b*sqrt(c + d*x))/(b**2*d**2) + 10*x**2*cos(a + b*sqrt (c + d*x))/(b**2*d) - 16*c*sqrt(c + d*x)*sin(a + b*sqrt(c + d*x))/(b**3*d* *3) - 40*x*sqrt(c + d*x)*sin(a + b*sqrt(c + d*x))/(b**3*d**2) - 96*c*cos(a + b*sqrt(c + d*x))/(b**4*d**3) - 120*x*cos(a + b*sqrt(c + d*x))/(b**4*d** 2) + 240*sqrt(c + d*x)*sin(a + b*sqrt(c + d*x))/(b**5*d**3) + 240*cos(a + b*sqrt(c + d*x))/(b**6*d**3), True))
Leaf count of result is larger than twice the leaf count of optimal. 672 vs. \(2 (310) = 620\).
Time = 0.29 (sec) , antiderivative size = 672, normalized size of antiderivative = 1.94 \[ \int x^2 \cos \left (a+b \sqrt {c+d x}\right ) \, dx=-\frac {2 \, {\left (a c^{2} \sin \left (\sqrt {d x + c} b + a\right ) - {\left ({\left (\sqrt {d x + c} b + a\right )} \sin \left (\sqrt {d x + c} b + a\right ) + \cos \left (\sqrt {d x + c} b + a\right )\right )} c^{2} - \frac {2 \, a^{3} c \sin \left (\sqrt {d x + c} b + a\right )}{b^{2}} + \frac {6 \, {\left ({\left (\sqrt {d x + c} b + a\right )} \sin \left (\sqrt {d x + c} b + a\right ) + \cos \left (\sqrt {d x + c} b + a\right )\right )} a^{2} c}{b^{2}} + \frac {a^{5} \sin \left (\sqrt {d x + c} b + a\right )}{b^{4}} - \frac {5 \, {\left ({\left (\sqrt {d x + c} b + a\right )} \sin \left (\sqrt {d x + c} b + a\right ) + \cos \left (\sqrt {d x + c} b + a\right )\right )} a^{4}}{b^{4}} - \frac {6 \, {\left (2 \, {\left (\sqrt {d x + c} b + a\right )} \cos \left (\sqrt {d x + c} b + a\right ) + {\left ({\left (\sqrt {d x + c} b + a\right )}^{2} - 2\right )} \sin \left (\sqrt {d x + c} b + a\right )\right )} a c}{b^{2}} + \frac {10 \, {\left (2 \, {\left (\sqrt {d x + c} b + a\right )} \cos \left (\sqrt {d x + c} b + a\right ) + {\left ({\left (\sqrt {d x + c} b + a\right )}^{2} - 2\right )} \sin \left (\sqrt {d x + c} b + a\right )\right )} a^{3}}{b^{4}} + \frac {2 \, {\left (3 \, {\left ({\left (\sqrt {d x + c} b + a\right )}^{2} - 2\right )} \cos \left (\sqrt {d x + c} b + a\right ) + {\left ({\left (\sqrt {d x + c} b + a\right )}^{3} - 6 \, \sqrt {d x + c} b - 6 \, a\right )} \sin \left (\sqrt {d x + c} b + a\right )\right )} c}{b^{2}} - \frac {10 \, {\left (3 \, {\left ({\left (\sqrt {d x + c} b + a\right )}^{2} - 2\right )} \cos \left (\sqrt {d x + c} b + a\right ) + {\left ({\left (\sqrt {d x + c} b + a\right )}^{3} - 6 \, \sqrt {d x + c} b - 6 \, a\right )} \sin \left (\sqrt {d x + c} b + a\right )\right )} a^{2}}{b^{4}} + \frac {5 \, {\left (4 \, {\left ({\left (\sqrt {d x + c} b + a\right )}^{3} - 6 \, \sqrt {d x + c} b - 6 \, a\right )} \cos \left (\sqrt {d x + c} b + a\right ) + {\left ({\left (\sqrt {d x + c} b + a\right )}^{4} - 12 \, {\left (\sqrt {d x + c} b + a\right )}^{2} + 24\right )} \sin \left (\sqrt {d x + c} b + a\right )\right )} a}{b^{4}} - \frac {5 \, {\left ({\left (\sqrt {d x + c} b + a\right )}^{4} - 12 \, {\left (\sqrt {d x + c} b + a\right )}^{2} + 24\right )} \cos \left (\sqrt {d x + c} b + a\right ) + {\left ({\left (\sqrt {d x + c} b + a\right )}^{5} - 20 \, {\left (\sqrt {d x + c} b + a\right )}^{3} + 120 \, \sqrt {d x + c} b + 120 \, a\right )} \sin \left (\sqrt {d x + c} b + a\right )}{b^{4}}\right )}}{b^{2} d^{3}} \]
-2*(a*c^2*sin(sqrt(d*x + c)*b + a) - ((sqrt(d*x + c)*b + a)*sin(sqrt(d*x + c)*b + a) + cos(sqrt(d*x + c)*b + a))*c^2 - 2*a^3*c*sin(sqrt(d*x + c)*b + a)/b^2 + 6*((sqrt(d*x + c)*b + a)*sin(sqrt(d*x + c)*b + a) + cos(sqrt(d*x + c)*b + a))*a^2*c/b^2 + a^5*sin(sqrt(d*x + c)*b + a)/b^4 - 5*((sqrt(d*x + c)*b + a)*sin(sqrt(d*x + c)*b + a) + cos(sqrt(d*x + c)*b + a))*a^4/b^4 - 6*(2*(sqrt(d*x + c)*b + a)*cos(sqrt(d*x + c)*b + a) + ((sqrt(d*x + c)*b + a)^2 - 2)*sin(sqrt(d*x + c)*b + a))*a*c/b^2 + 10*(2*(sqrt(d*x + c)*b + a) *cos(sqrt(d*x + c)*b + a) + ((sqrt(d*x + c)*b + a)^2 - 2)*sin(sqrt(d*x + c )*b + a))*a^3/b^4 + 2*(3*((sqrt(d*x + c)*b + a)^2 - 2)*cos(sqrt(d*x + c)*b + a) + ((sqrt(d*x + c)*b + a)^3 - 6*sqrt(d*x + c)*b - 6*a)*sin(sqrt(d*x + c)*b + a))*c/b^2 - 10*(3*((sqrt(d*x + c)*b + a)^2 - 2)*cos(sqrt(d*x + c)* b + a) + ((sqrt(d*x + c)*b + a)^3 - 6*sqrt(d*x + c)*b - 6*a)*sin(sqrt(d*x + c)*b + a))*a^2/b^4 + 5*(4*((sqrt(d*x + c)*b + a)^3 - 6*sqrt(d*x + c)*b - 6*a)*cos(sqrt(d*x + c)*b + a) + ((sqrt(d*x + c)*b + a)^4 - 12*(sqrt(d*x + c)*b + a)^2 + 24)*sin(sqrt(d*x + c)*b + a))*a/b^4 - (5*((sqrt(d*x + c)*b + a)^4 - 12*(sqrt(d*x + c)*b + a)^2 + 24)*cos(sqrt(d*x + c)*b + a) + ((sqr t(d*x + c)*b + a)^5 - 20*(sqrt(d*x + c)*b + a)^3 + 120*sqrt(d*x + c)*b + 1 20*a)*sin(sqrt(d*x + c)*b + a))/b^4)/(b^2*d^3)
Time = 0.28 (sec) , antiderivative size = 480, normalized size of antiderivative = 1.39 \[ \int x^2 \cos \left (a+b \sqrt {c+d x}\right ) \, dx=\frac {2 \, {\left (\frac {{\left (b^{4} c^{2} - 6 \, {\left (\sqrt {d x + c} b + a\right )}^{2} b^{2} c + 12 \, {\left (\sqrt {d x + c} b + a\right )} a b^{2} c - 6 \, a^{2} b^{2} c + 5 \, {\left (\sqrt {d x + c} b + a\right )}^{4} - 20 \, {\left (\sqrt {d x + c} b + a\right )}^{3} a + 30 \, {\left (\sqrt {d x + c} b + a\right )}^{2} a^{2} - 20 \, {\left (\sqrt {d x + c} b + a\right )} a^{3} + 5 \, a^{4} + 12 \, b^{2} c - 60 \, {\left (\sqrt {d x + c} b + a\right )}^{2} + 120 \, {\left (\sqrt {d x + c} b + a\right )} a - 60 \, a^{2} + 120\right )} \cos \left (\sqrt {d x + c} b + a\right )}{b^{4} d^{2}} + \frac {{\left ({\left (\sqrt {d x + c} b + a\right )} b^{4} c^{2} - a b^{4} c^{2} - 2 \, {\left (\sqrt {d x + c} b + a\right )}^{3} b^{2} c + 6 \, {\left (\sqrt {d x + c} b + a\right )}^{2} a b^{2} c - 6 \, {\left (\sqrt {d x + c} b + a\right )} a^{2} b^{2} c + 2 \, a^{3} b^{2} c + {\left (\sqrt {d x + c} b + a\right )}^{5} - 5 \, {\left (\sqrt {d x + c} b + a\right )}^{4} a + 10 \, {\left (\sqrt {d x + c} b + a\right )}^{3} a^{2} - 10 \, {\left (\sqrt {d x + c} b + a\right )}^{2} a^{3} + 5 \, {\left (\sqrt {d x + c} b + a\right )} a^{4} - a^{5} + 12 \, {\left (\sqrt {d x + c} b + a\right )} b^{2} c - 12 \, a b^{2} c - 20 \, {\left (\sqrt {d x + c} b + a\right )}^{3} + 60 \, {\left (\sqrt {d x + c} b + a\right )}^{2} a - 60 \, {\left (\sqrt {d x + c} b + a\right )} a^{2} + 20 \, a^{3} + 120 \, \sqrt {d x + c} b\right )} \sin \left (\sqrt {d x + c} b + a\right )}{b^{4} d^{2}}\right )}}{b^{2} d} \]
2*((b^4*c^2 - 6*(sqrt(d*x + c)*b + a)^2*b^2*c + 12*(sqrt(d*x + c)*b + a)*a *b^2*c - 6*a^2*b^2*c + 5*(sqrt(d*x + c)*b + a)^4 - 20*(sqrt(d*x + c)*b + a )^3*a + 30*(sqrt(d*x + c)*b + a)^2*a^2 - 20*(sqrt(d*x + c)*b + a)*a^3 + 5* a^4 + 12*b^2*c - 60*(sqrt(d*x + c)*b + a)^2 + 120*(sqrt(d*x + c)*b + a)*a - 60*a^2 + 120)*cos(sqrt(d*x + c)*b + a)/(b^4*d^2) + ((sqrt(d*x + c)*b + a )*b^4*c^2 - a*b^4*c^2 - 2*(sqrt(d*x + c)*b + a)^3*b^2*c + 6*(sqrt(d*x + c) *b + a)^2*a*b^2*c - 6*(sqrt(d*x + c)*b + a)*a^2*b^2*c + 2*a^3*b^2*c + (sqr t(d*x + c)*b + a)^5 - 5*(sqrt(d*x + c)*b + a)^4*a + 10*(sqrt(d*x + c)*b + a)^3*a^2 - 10*(sqrt(d*x + c)*b + a)^2*a^3 + 5*(sqrt(d*x + c)*b + a)*a^4 - a^5 + 12*(sqrt(d*x + c)*b + a)*b^2*c - 12*a*b^2*c - 20*(sqrt(d*x + c)*b + a)^3 + 60*(sqrt(d*x + c)*b + a)^2*a - 60*(sqrt(d*x + c)*b + a)*a^2 + 20*a^ 3 + 120*sqrt(d*x + c)*b)*sin(sqrt(d*x + c)*b + a)/(b^4*d^2))/(b^2*d)
Timed out. \[ \int x^2 \cos \left (a+b \sqrt {c+d x}\right ) \, dx=\int x^2\,\cos \left (a+b\,\sqrt {c+d\,x}\right ) \,d x \]